<?php if($items): ?>
<ul>
	<?php foreach($items as $item): ?>
		<?php if($item['hidden'])continue; ?>
	
		<?php
			$cur_params = array_merge($params, array('p'.($item['level']-1) => $item['slug']));
		?>
	
		<li>
			<a class="sub<?php echo $level ?> <?php if($item['active']): ?>active<?php endif; ?>" href="<?php echo $item['link'] ?>"><?php echo $item['title'] ?></a>
		
		<?php if($item['active'] && isset($item['node'])): ?>
			<?php $nested = get_partial('rightMenuWidget/nested_menu', array('level' => $level + 1,'helper' => $helper, 'params' => $cur_params ,'items' => $helper->getItemChildren($item['node'],$cur_params))) ?>
			<?php if($nested): ?>
			
				<?php echo $nested ?>
			
			<?php endif; ?>
		<?php endif; ?>
		</li>
	<?php endforeach; ?>
</ul>
<?php endif; ?>